import React, { Component } from 'react';

import MpUrl from '@/route/getparam';
import { getUserInfo } from '@/api/user';

export default class AccountDetail extends Component{
	constructor (props) {
		super(props)
		this.state = {
			userInfo: {}
		}
	}
	componentDidMount () {
		let getUrl = new MpUrl()
		this.setState({
			employee_id: getUrl.get('employee_id')
		}, () => {
			getUserInfo({employee_id:  getUrl.get('employee_id')}).then(res => {
				this.setState({
					userInfo: res.data
				})
			})
		})
	}
	render () {
		return (
			<div className="user-card--body">
				<div className="user-card--title">
					<div className="user-card--info">
						<div>
							<img src={this.state.userInfo.employee_img} alt='略略' />
							<div className="inline-block">{this.state.userInfo.employee_name}</div>
						</div>
						<div className="text-center">
							{this.state.userInfo.position_name}丨{this.state.userInfo.employee_position_name}丨{this.state.userInfo.telephone}
						</div>
					</div>
				</div>
				<div className='user-card--img'>
					<div className="img-group">
						<img src={this.state.userInfo.max_two_bar_code} alt='11'/>
						<span>长按查看小程序名片</span>
					</div>
				</div>
			</div>
		)
	}
}
